package com.dems.admin.security;

import com.alibaba.fastjson.JSONObject;
import com.dems.dao.dataobject.User;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtils {
    /**
     * 获取当前登录用户的openId
     *
     * @return
     */
    public static User getLoanassistUser() {
        Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return JSONObject.parseObject((String) principal, User.class);
    }

}
